local skill = fk.CreateSkill {
  name = "#ling__sacrifice_axe_skill",
  tags = { Skill.Compulsory },
  attached_equip = "ling__sacrifice_axe",
}

Fk:loadTranslationTable {
  ["#ling__sacrifice_axe_skill"] = "祭祀斧",
}

skill:addEffect(fk.Damage, {
  can_trigger = function(self, event, target, player, data)
    if target == player and player:hasSkill(skill.name) and
        data.card and data.card.trueName == "slash" and data.by_user and
        player:isWounded() then
      local damage_events = player.room.logic:getActualDamageEvents(1, function(e)
        local damage = e.data
        return damage.from == player and damage.card ~= nil and damage.card.trueName == "slash"
      end, Player.HistoryTurn)
      return #damage_events == 1 and damage_events[1].data == data
    end
  end,
  on_use = function(self, event, target, player, data)
    player.room:recover({
      who = player,
      num = 1,
      recoverBy = player,
      skillName = skill.name,
    })
  end,
})

return skill
